package com.example.demo.controller;

import com.example.demo.entity.Student;
import com.example.demo.entity.User;
import com.example.demo.mapper.UserMapper;
import jakarta.annotation.Resource;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.ResponseBody;

@Controller
public class TestController {

    @Resource
    private UserMapper mapper;

    @GetMapping("/login")
    public String login() {
        return "login";
    }
    @ResponseBody
    @GetMapping("/test")
    public User user(){
        return mapper.findUserById(1);
    }
}
